using System;
using System.Collections.Generic;
using System.Linq;

namespace Corelib.Entities
{
	[Table(Name = "dbo.DonationPlace")]
	public class DonationPlace
	{

		#region Private Data Members

		private int  _donationPlaceID;
		private string  _donationPlaceName;
		private DateTime  _createDate;
		private DateTime  _modifyDate;

		#endregion

		#region Private "Static" Data Members

		private static readonly string[] _propertyNames = new string[] {
			"DonationPlaceID",
			"DonationPlaceName",
			"CreateDate",
			"ModifyDate",
		};

		#endregion

		#region Constants

		public const int 
			FieldDonationPlaceIDIdx = 0,
			FieldDonationPlaceNameIdx = 1,
			FieldCreateDateIdx = 2,
			FieldModifyDateIdx = 3;

		#endregion

		#region Private instance data members

		private FieldInfo[] _fieldInfo = new FieldInfo[]{
			new FieldInfo(FieldDonationPlaceIDIdx,FieldType.Primitive),
			new FieldInfo(FieldDonationPlaceNameIdx,FieldType.Primitive),
			new FieldInfo(FieldCreateDateIdx,FieldType.Primitive),
			new FieldInfo(FieldModifyDateIdx,FieldType.Primitive),
		};

		#endregion

		#region Public Properties

		[Column(DBType = "int not null")]
		public int DonationPlaceID
		{
			get { return this.GetHelper(_fieldInfo, _propertyNames, FieldDonationPlaceIDIdx,  _donationPlaceID); }
			set {  _donationPlaceID = this.SetValueTypeHelper(_fieldInfo, FieldDonationPlaceIDIdx,  _donationPlaceID, value,  _donationPlaceID == value); }
		}

		[Column(DBType = "nvarchar(20) not null")]
		public string DonationPlaceName
		{
			get { return this.GetHelper(_fieldInfo, _propertyNames, FieldDonationPlaceNameIdx,  _donationPlaceName); }
			set {  _donationPlaceName = this.SetValueTypeHelper(_fieldInfo, FieldDonationPlaceNameIdx,  _donationPlaceName, value,  _donationPlaceName == value); }
		}

		[Column(DBType = "datetime not null")]
		public DateTime CreateDate
		{
			get { return this.GetHelper(_fieldInfo, _propertyNames, FieldCreateDateIdx,  _createDate); }
			set {  _createDate = this.SetValueTypeHelper(_fieldInfo, FieldCreateDateIdx,  _createDate, value,  _createDate == value); }
		}

		[Column(DBType = "datetime null")]
		public DateTime ModifyDate
		{
			get { return this.GetHelper(_fieldInfo, _propertyNames, FieldModifyDateIdx,  _modifyDate); }
			set {  _modifyDate = this.SetValueTypeHelper(_fieldInfo, FieldModifyDateIdx,  _modifyDate, value,  _modifyDate == value); }
		}

		#endregion
	}
}
